package com.jt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jt.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    User findUserByUP(User user);
    @Select("select count(1) from user")
    long findTotal();

    List<User> findUserList(@Param("query") String query,@Param("start") int start,@Param("size") int size);
    @Update("update user set status=#{status} where id=#{id}")
    void updateStatus(User user);

    void addUser(User user);
    @Select("select * from user where id=#{id}")
    User findUserById(Integer id);


    void updateUser(User user);
    @Delete("delete from user where id=#{id}")
    void deleteById(Integer id);
}
